package avicit.bdp.dgs.mdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-06 11:02
 * @类说明：
 * @修改记录：
 */
@ApiModel(value = "MdataInterfaceDTO", description = "接口管理表")
@Table(name = "bdp_dgs_mdata_interface")
public class MdataInterfaceDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 接口名称
     */
    @LogField
    @ApiModelProperty(value = "接口名称", name = "name")
    @FieldRemark(column = "name", field = "name", name = "接口名称")
    private String name;

    /**
     * 接口编码
     */
    @LogField
    @ApiModelProperty(value = "接口编码", name = "code")
    @FieldRemark(column = "code", field = "code", name = "接口编码")
    private String code;

    /**
     * 请求方法
     */
    @LogField
    @ApiModelProperty(value = "请求方法", name = "method")
    @FieldRemark(column = "method", field = "method", name = "请求方法")
    private String method;

    /**
     * 接口地址
     */
    @LogField
    @ApiModelProperty(value = "接口地址", name = "address")
    @FieldRemark(column = "address", field = "address", name = "接口地址")
    private String address;

    /**
     * 接口超时时间(秒)
     */
    @LogField
    @ApiModelProperty(value = "接口超时时间(秒)", name = "timeout")
    @FieldRemark(column = "timeout", field = "timeout", name = "接口超时时间(秒)")
    private Integer timeout;

    /**
     * 每次推送数据大小
     */
    @LogField
    @ApiModelProperty(value = "每次推送数据大小", name = "dataSize")
    @FieldRemark(column = "data_size", field = "dataSize", name = "每次推送数据大小")
    private Integer dataSize;

    /**
     * 数据流向，1-数据流入，2-数据流出
     */
    @LogField
    @ApiModelProperty(value = "数据流向", name = "dataFlow")
    @FieldRemark(column = "data_flow", field = "dataFlow", name = "数据流向")
    private Integer dataFlow;

    /**
     * 所属系统
     */
    @LogField
    @ApiModelProperty(value = "所属系统", name = "applicationId")
    @FieldRemark(column = "application_id", field = "applicationId", name = "所属系统")
    private String applicationId;

    /**
     * 数据类型,json、xml
     */
    @LogField
    @ApiModelProperty(value = "数据类型,json、xml", name = "dataType")
    @FieldRemark(column = "data_type", field = "dataType", name = "数据类型,json、xml")
    private String dataType;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", name = "remark")
    @FieldRemark(column = "remark", field = "remark", name = "描述")
    private String remark;

    /**
     * 状态，1-启用，0-停用
     */
    @ApiModelProperty(value = "状态，1-启用，0-停用", name = "status")
    @FieldRemark(column = "status", field = "status", name = "状态")
    private Integer status;

    @Transient
    private String statusName;
    @Transient
    private String dataFlowName;
    @Transient
    private String applicationName;
    @Transient
    private String pushButton;

    public String getPushButton() {
        return pushButton;
    }

    public void setPushButton(String pushButton) {
        this.pushButton = pushButton;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getDataFlowName() {
        return dataFlowName;
    }

    public void setDataFlowName(String dataFlowName) {
        this.dataFlowName = dataFlowName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public Integer getDataSize() {
        return dataSize;
    }

    public void setDataSize(Integer dataSize) {
        this.dataSize = dataSize;
    }

    public Integer getDataFlow() {
        return dataFlow;
    }

    public void setDataFlow(Integer dataFlow) {
        this.dataFlow = dataFlow;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "bdp_dgs_mdata_interface";
        } else {
            return super.logFormName;
        }
    }

    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "bdp_dgs_mdata_interface";
        } else {
            return super.logTitle;
        }
    }

    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
